package com.jcsz.gulimall.seckill.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * @className: HelloController
 * @author: 一把Po吉他
 * @date: 2022/11/17 18:08
 * @version: 1.0
 **/
@Component
@EnableScheduling
@Slf4j
@EnableAsync
public class HelloController {

    //@Scheduled(cron = "* * * ? * 4")
    @Async
    public void hello() {
        log.info("hello~");
        try { TimeUnit.MILLISECONDS.sleep(3000);} catch (InterruptedException e) {e.printStackTrace();}

    }
}
